﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HelloLLLLL.Blog.Models;
using HelloLLLLL.Blog.Common;
using HelloLLLLL.Blog.DAL;
namespace HelloLLLLL.Blog.Admin.page
{
    public partial class LLBannerList : System.Web.UI.Page
    {
        public int BannerCount = 0;
        DBHelper helper = new DBHelper();
        protected void Page_Load(object sender, EventArgs e)
        {

            string action = Request.QueryString["action"];

            if ("delete" == action)
            {
                DeleteBanner(Request.QueryString["id"]);
            }
            BannerCount = Convert.ToInt32(helper.GetScalar("select count(1) from Banner", null));

        }

        private void DeleteBanner(string i)
        {
            int id = int.Parse(i);
            if (id > 0)
            {
                helper.GetNonQuery("delete from banner where id=" + id);
            }
        }

        
    }
}